package com.redwolfsoft.libshoppingserver.datafetcher;

import java.util.ArrayList;
import java.util.List;


import com.redwolfsoft.libshoppingserver.brand.BrandAuthorizedShopInfo;
import com.redwolfsoft.libshoppingserver.brand.BrandInfo;
import com.redwolfsoft.libshoppingserver.brand.CommentInfo;
import com.redwolfsoft.libshoppingserver.brand.BrandShopArea;
import com.redwolfsoft.libshoppingserver.brand.BrandShopInfo;
import com.redwolfsoft.libshoppingserver.brand.BrandStoryInfo;
import com.redwolfsoft.libshoppingserver.brand.CountryCategory;
import com.redwolfsoft.libshoppingserver.brand.NewProductInfo;
import com.redwolfsoft.libshoppingserver.brand.RecommendCategoryInfo;
import com.redwolfsoft.libshoppingserver.brand.Story;
import com.redwolfsoft.libshoppingserver.common.HttpConstants;
import com.redwolfsoft.libshoppingserver.favorite.FavoriteBrandItemInfo;
import com.redwolfsoft.libshoppingserver.favorite.FavoriteShoppingcenterItemInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterBrandInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterPromotionInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterShopFloorInfo;
import com.redwolfsoft.libshoppingserver.shoppingcenter.ShoppingCenterShopInfo;

public class MockDataFetcher2 implements DataFetcher {
	String[] CountryArray = { "中国", "美国", "法国", "德国", "英国", "意大利", "日本",
			"澳大利亚", "比利时"

	};

	String[] BrandsArray = { "Dior", "Esprit", "VeroModa",
			"H&M", "Zara","brandA", "brandB", "brandC"};
	// 定义url
	String WebBase = "http://www.zjgogo.com/hjb/images/";
	// 图片名
	String[] BrandsPicFileNameArray = {  "fb02.jpg", "fb03.jpg",
			 "fb05.jpg", "fb06.jpg", "fb07.jpg", "fb08.jpg",
			 "fb09.jpg",  "fb12.jpg" };
	@Override
	public List<CountryCategory> getCountryCategoryBrandInfoList() {		
	


		List<CountryCategory> mCountryCategoryList = new ArrayList<CountryCategory>();

		// CountryArray 长度8
		for (int i = 0; i < CountryArray.length; i++) {
			ArrayList<BrandInfo> list = new ArrayList<BrandInfo>();
			// BrandsArray 长度8
			for (int j = 0; j < BrandsArray.length; j++) {

				// 点击首页中间图片进去-->网店:名字+网店url
				List<BrandAuthorizedShopInfo> mAuthorizedShopList = new ArrayList<BrandAuthorizedShopInfo>();

				for (int k = 0; k < 6; k++) {
					// Dior-0Authorized Shop0
					BrandAuthorizedShopInfo info = new BrandAuthorizedShopInfo(
							BrandsArray[j] + "-" + i + " Authorized Shop" + k,
							"http://www.eedata.cn/news/mainAction!main.action"
									+ k);
					mAuthorizedShopList.add(info);
				}
				// 保存一些专卖店和列表点进去的信息
				ArrayList<BrandShopInfo> list2 = new ArrayList<BrandShopInfo>();
				for (int l = 0; l < 8; l++) {
					BrandShopInfo info = new BrandShopInfo(i+"", "商场" + l, "专卖店"
							+ l, "Floor2", "长安街8号宇宙中心", "010-88888888", null
							,0.0,0.0);
					list2.add(info);
				}
				BrandInfo info = new BrandInfo((i * 100 + j)+"", BrandsArray[j],
						WebBase + BrandsPicFileNameArray[j],
						null,
						BrandsPicFileNameArray[j]
						   //,null					                 
						//,mAuthorizedShopList, list2
						);
				list.add(info);
			}
			
			CountryCategory c = new CountryCategory(i+"", CountryArray[i], list);
			mCountryCategoryList.add(c);
		}
		return mCountryCategoryList;
	}

	@Override
	public List<NewProductInfo> getNewProductInfoList(String brandid) {
		List<NewProductInfo> mList = new ArrayList<NewProductInfo>();
		
		//String WebBase = "http://192.168.1.3/eBiz/aikang/products/hjb/images/";
		String[] ProductsFileNameArray = {  "fb02.jpg", "fb03.jpg",
				 "fb05.jpg", "fb06.jpg", "fb07.jpg", "fb08.jpg",
				 "fb09.jpg",  "fb12.jpg" };
		// String[] resTextArray =
		// getResources().getStringArray(R.array.array_characterType);

		for (int i = 0; i < ProductsFileNameArray.length; i++) {
			NewProductInfo info = new NewProductInfo(
					i+"",
					"newproduct" + i,
					WebBase + ProductsFileNameArray[i],
					null,
					ProductsFileNameArray[i], 0, 0, WebBase
							+ ProductsFileNameArray[i], "big-"
							+ ProductsFileNameArray[i]);
			info.numApplaud=10;
			
			mList.add(info);
		}
		return mList;
	}

	@Override
	public List<BrandShopArea> getBrandShopAreaList(String countryid,String brandid,double longitide, double latitude, int page) {

		List<BrandShopArea> mList = new ArrayList<BrandShopArea>();

		// CountryArray 长度8
		for (int i = 0; i < CountryArray.length; i++) {
			// 保存一些专卖店和列表点进去的信息
			ArrayList<BrandShopInfo> list2 = new ArrayList<BrandShopInfo>();
			for (int l = 0; l < 8; l++) {
				BrandShopInfo info = new BrandShopInfo(l+"", brandid+"-"+i+"-商场" + l, "专卖店"
						+ l, "location-Floor2", "长安街8号宇宙中心", "010-88888888", null
						,0.0,0.0);
				list2.add(info);
			}
			BrandShopArea c = new BrandShopArea(i+"", CountryArray[i], list2);
			mList.add(c);
				
		}
			
		return mList;
	}

	@Override
	public List<CommentInfo> getBrandReviewInfoList(String brandid) {
		List<CommentInfo> mList = null;
		String[]userArray = new String[]{"user1", "", "user2", "user3", 
				"user4", "user5",
				"user6", "user7"};	
	String[]msgArray = new String[]{
			"review of "+brandid,
		 "我也有",
		 "那上吧", 
				"Used for being notified when a group is expanded ",
				"Used for being notified when a group is expanded ",
				"Used for being notified when a group is expanded  "};

	String[]dateArray = new String[]{"2012-09-01 18:00", "2012-09-01 18:10", 
				"2012-09-01 18:11", "2012-09-01 18:20", 
				"2012-09-01 18:30", "2012-09-01 18:35", 
				"2012-09-01 18:40", "2012-09-01 18:50"}; 
	
	mList = new ArrayList<CommentInfo>();
	for(int i=0;i<msgArray.length;i++)
	{
		CommentInfo info = new CommentInfo(userArray[i],dateArray[i],msgArray[i]);
		mList.add(info);
	}
		return mList;
	}

	@Override
	public List<ShoppingCenterInfo> getShoppingCenterInfoList(int type,
			double longititue,double latitude, String address, int page,String userid) {
		 List<ShoppingCenterInfo> mList = new ArrayList<ShoppingCenterInfo>();
		for(int i=0;i<5;i++)
		{/*
			List<ShoppingCenterBrandInfo> list = new ArrayList<ShoppingCenterBrandInfo>();
			for(int j=0;j<6;j++)
			{
				ShoppingCenterBrandInfo brand = 
					new ShoppingCenterBrandInfo(i*100+j,"Brand in ShoppingCenter"+j,"address"+j);
				list.add(brand);
			}
			
			List<ShoppingCenterShopInfo> list2 = new ArrayList<ShoppingCenterShopInfo>();
			for(int l=0;l<6;l++)
			{
				ShoppingCenterShopInfo brand = 
					new ShoppingCenterShopInfo("ShoppingCenter Shop"+i+"-"+l,l);
				list2.add(brand);
			}
			*/
			ShoppingCenterInfo info = null;
			if(type==HttpConstants.SHOPPINGCENTER_TYPE_NEARBY)
				info = new ShoppingCenterInfo(i+"",
					"NearybyShoppingCenter"+i,"subname"+i,false
					//,list,list2
					);
			else if(type==HttpConstants.SHOPPINGCENTER_TYPE_SEARCH)
				info = new ShoppingCenterInfo(i+"",
						"Search_ShoppingCenter"+i,"subname"+i,false
						//,list,list2
						);
			info.longititude=116.374252;
			info.latitude=40.019561;
			info.address = "五道口宇宙中心";
			info.email = "service@paskon.com";
			info.tel = "400-1234-5678";
			info.serviceSlot = "Available 9:00~18:00";
			
			mList.add(info);
			
			
		}
		return mList;
	}

	@Override
	public List<BrandAuthorizedShopInfo> getAuthorizedBrandEShopInfoList(
			String brandid) {
		List<BrandAuthorizedShopInfo> mAuthorizedShopList = new ArrayList<BrandAuthorizedShopInfo>();

		for (int k = 0; k < 6; k++) {
			// Dior-0Authorized Shop0
			BrandAuthorizedShopInfo info = new BrandAuthorizedShopInfo(
					BrandsArray[k] + "-" + brandid + " Authorized Shop" + k,
					"http://www.eedata.cn/news/mainAction!main.action"
							+ k);
			mAuthorizedShopList.add(info);
		}
		return mAuthorizedShopList;
	}

	@Override
	public boolean addReview(String user, String deviceId, String review,
			String brandid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public List<ShoppingCenterPromotionInfo> getShoppingCenterPromotionInfoList(
			String shoppingcenterId) {
		 List<ShoppingCenterPromotionInfo> mList = new ArrayList<ShoppingCenterPromotionInfo>();
			for(int i=0;i<5;i++)
			{
				ShoppingCenterPromotionInfo info = 
					new ShoppingCenterPromotionInfo(
					"promotion info for shoppingcenterId:"+shoppingcenterId	);

				
				mList.add(info);
				
				
			}
			return mList;
	}

	@Override
	public List<ShoppingCenterShopInfo> getShoppingCenterShopInfoList(
			String shoppingcenterId) {
		 List<ShoppingCenterShopInfo> mList = new ArrayList<ShoppingCenterShopInfo>();
			for(int i=0;i<5;i++)
			{
				List<ShoppingCenterBrandInfo> list = new ArrayList<ShoppingCenterBrandInfo>();
				for(int j=0;j<6;j++)
				{
					ShoppingCenterBrandInfo info1 = 
						new ShoppingCenterBrandInfo(i+"",
						"Brand "+i+" in shoppingcenter,Id:"+shoppingcenterId, "address-"+i	);
					
					list.add(info1);
				}
				ShoppingCenterShopInfo info = 
					new ShoppingCenterShopInfo(
					"General Category"+i+" for shoppingcenterId="+shoppingcenterId, i+3,list);
				
				mList.add(info);
				
				
			}
			return mList;
	}

	@Override
	public List<ShoppingCenterBrandInfo> getShoppingCenterBrandInfoList(
			String shoppingcenterId) {
		 List<ShoppingCenterBrandInfo> mList = new ArrayList<ShoppingCenterBrandInfo>();
			for(int i=0;i<5;i++)
			{
				ShoppingCenterBrandInfo info = 
					new ShoppingCenterBrandInfo(i+"",
					"ShoppingCenter brand Info for shoppingcenterId:"+shoppingcenterId, "address-"+i	);
				
				mList.add(info);
				
				
			}
			return mList;
	}

	@Override
	public List<FavoriteShoppingcenterItemInfo> getFavoritedShoppingCenterList(String user,
			String deviceId) {
		 List<FavoriteShoppingcenterItemInfo> mList = new ArrayList<FavoriteShoppingcenterItemInfo>();
			for(int i=0;i<5;i++)
			{
				FavoriteShoppingcenterItemInfo info = 
					new FavoriteShoppingcenterItemInfo(i+"",
					"ShoppingCenter", "http://www.eedata.com/pic/logo.png"	);
				
				mList.add(info);
				
				
			}
			return mList;
	}

	@Override
	public List<FavoriteBrandItemInfo> getFavoritedBrandInfoList(String user,
			String deviceId) {
		 List<FavoriteBrandItemInfo> mList = new ArrayList<FavoriteBrandItemInfo>();
			for(int i=0;i<5;i++)
			{
				FavoriteBrandItemInfo info = 
					new FavoriteBrandItemInfo(i+"",
					"brand", "http://www.eedata.com/pic/logo.png");
				
				mList.add(info);
				
				
			}
			return mList;
	}

	@Override
	public BrandStoryInfo getBrandStoryInfo(String brandid) {
		List<Story> storyList = new ArrayList<Story>();
		for(int i = 0; i<5;i++){
			Story  s = new Story(i,"StoryTitle"+i,"Here is Story Brief"+i,"2013.12.12"
					,i+2,"http://www.baidu.com/img/bdlogo.gif","http://www.qq.com/");
			storyList.add(s);
		}
		BrandStoryInfo info = new BrandStoryInfo("http://www.baidu.com/img/bdlogo.gif"
				,"这儿是品牌简介",storyList);
		return info;
	}

	@Override
	public List<RecommendCategoryInfo> getRecommendCategoryInfo(double longititue,double latitude,  int page,String userid) {
		List<RecommendCategoryInfo> list= new ArrayList<RecommendCategoryInfo>();
		for(int i=0;i<5;i++)
		{
			 List<ShoppingCenterInfo> mList = new ArrayList<ShoppingCenterInfo>();
				for(int j=0;j<6;j++)
				{/*
					List<ShoppingCenterBrandInfo> list = new ArrayList<ShoppingCenterBrandInfo>();
					for(int j=0;j<6;j++)
					{
						ShoppingCenterBrandInfo brand = 
							new ShoppingCenterBrandInfo(i*100+j,"Brand in ShoppingCenter"+j,"address"+j);
						list.add(brand);
					}
					
					List<ShoppingCenterShopInfo> list2 = new ArrayList<ShoppingCenterShopInfo>();
					for(int l=0;l<6;l++)
					{
						ShoppingCenterShopInfo brand = 
							new ShoppingCenterShopInfo("ShoppingCenter Shop"+i+"-"+l,l);
						list2.add(brand);
					}
					*/
					ShoppingCenterInfo info = null;
					
					info = new ShoppingCenterInfo(j+"",
							"RecommendShoppingCenter"+j,"subname"+j,false
							//,list,list2
							);

					info.longititude=116.374252;
					info.latitude=40.019561;
					info.address = "五道口宇宙中心";
					info.email = "service@paskon.com";
					info.tel = "400-1234-5678";
					info.serviceSlot = "Available 9:00~18:00";
					
					mList.add(info);
				}
				RecommendCategoryInfo rinfo = new RecommendCategoryInfo(i+"","RecommendCategory"+i,mList);
				list.add(rinfo);
		}
		return list;
	}

	@Override
	public List<ShoppingCenterShopFloorInfo> getShoppingCenterShopFloorInfoList(
			String shoppingcenterid) {
		 List<ShoppingCenterShopFloorInfo> mList = new ArrayList<ShoppingCenterShopFloorInfo>();
			for(int i=0;i<5;i++)
			{
				List<ShoppingCenterBrandInfo> list = new ArrayList<ShoppingCenterBrandInfo>();
				for(int j=0;j<6;j++)
				{
					ShoppingCenterBrandInfo info1 = 
						new ShoppingCenterBrandInfo(i+"",
								"Brand "+i+" in floor"+i+", shoppingcenter Id:"+shoppingcenterid, "address-"+i	);
					
					list.add(info1);
				}
				ShoppingCenterShopFloorInfo info = 
					new ShoppingCenterShopFloorInfo(
					"Floor"+i+" for shoppingcenterId="+shoppingcenterid, list);
				
				mList.add(info);
				
				
			}
			return mList;
	}

	@Override
	public boolean registerNewUser(String user, String passwd, String deviceid,
			String email, String mobile, String gender, String birthdate) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public String login(String email, String passwd, String deviceid) {
		// TODO Auto-generated method stub
		return "1";
	}

	@Override
	public boolean logout(String userid, String passwd, String deviceid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean addStoryComment(String userid, String deviceid,
			String review, String storyid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public List<CommentInfo> getStoryCommentInfoList(String brandid) {
		List<CommentInfo> mList = null;
		String[]userArray = new String[]{"user1", "", "user2", "user3", 
				"user4", "user5",
				"user6", "user7"};	
	String[]msgArray = new String[]{
			 "Story-comment1",
		 "Story-comment2",
		 "Story-comment3", 
		 "Story-comment4",
		 "Story-comment5",
		 "Story-comment6"};

	String[]dateArray = new String[]{"2012-09-01 18:00", "2012-09-01 18:10", 
				"2012-09-01 18:11", "2012-09-01 18:20", 
				"2012-09-01 18:30", "2012-09-01 18:35", 
				"2012-09-01 18:40", "2012-09-01 18:50"}; 
	
	mList = new ArrayList<CommentInfo>();
	for(int i=0;i<msgArray.length;i++)
	{
		CommentInfo info = new CommentInfo(userArray[i],dateArray[i],msgArray[i]);
		mList.add(info);
	}
		return mList;
	}

	@Override
	public boolean applaudNewProduct(String newproductid, String userid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean addFeedback(String userid, String deviceid, String feedback,
			String qq) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public List<BrandShopInfo> getBrandShopInfoList(String address,double longitide, double latitude, int page) {
		ArrayList<BrandShopInfo> list2 = new ArrayList<BrandShopInfo>();
		for (int l = 0; l < 8; l++) {
			BrandShopInfo info = new BrandShopInfo(l+"", "SearchResult:商场" + l, "专卖店"
					+ l, "location-Floor2", "长安街8号宇宙中心", "010-88888888", null
					,0.0,0.0);
			list2.add(info);
		}
		return list2;
	}

	@Override
	public boolean favoriteShoppingCenter(String userid, String deviceid,
			String shoppingcenterid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean favoriteBrand(String userid, String deviceid, String brandid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean isFavoriteBrand(String userid, String deviceid,
			String brandid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean isFavoriteShoppingCenter(String userid, String deviceid,
			String shoppingcenterid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean cancelFavoriteBrand(String userid, String deviceid,
			String brandid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean cancelFavoriteShoppingcenter(String userid, String deviceid,
			String shoppingcenterid) {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean isApplaudNewProduct(String userid, String deviceid,
			String newproductId) {
		// TODO Auto-generated method stub
		return true;
	}
}
